package com.qf.ssm.utils;

import lombok.Getter;
import org.springframework.stereotype.Component;

/**
 * 业务错误错误的状态码
 */
@Getter
public enum ResponseCode {
    /**
     * 返回成功
     */
    SUCCESS(200, "success", "成功"),

    ERROR(404, "error", "错误"),
    //    用户相关的状态信息
    USER_NOT_NAME(400010, "error", "用户名不存在"),
    /**
     * 用户被锁定
     */
    USER_IS_LOCKED(400012, "user is  locked", "用户被锁定,请于管理员联系"),
    /**
     *
     */
    USER_PASSWORD_NAME(400011, "password is error", "密码错误"),

    PROPERTY_EDIT(400017, "property edit error", "属性编辑失败"),

    GROUP_EDIT(400018, "group edit error", "属性组编辑失败"),

    PROPERTY_NEW(400016, "property new error", "属性新建失败"),

    GROUP_NEW(400025, "group new error", "属性组新建失败"),

    PROPERTY_DELETE(400019, "property delete error", "属性删除失败"),

    GROUP_DELETE(400026, "group delete error", "属性组删除失败"),

    PROPERTY_BATCH_DELETE(400022, "property batchDelete error", "属性批量删除失败"),

    PROPERTY_DISABLE(400020, "property disable error", "属性禁用失败"),

    GROUP_DISABLE(400023, "group disable error", "属性组禁用失败"),

    PROPERTY_ENABLE(400022, "property enable error", "属性启用失败"),

    GROUP_ENABLE(400024, "group enable error", "属性组启用失败"),

    PROPERTY_SELECT(400015, "property query error", "属性查询失败"),

    GROUP_SELECT(400021, "group query error", "属性组查询失败");

    /**
     * 返回码
     */
    protected int status;
    /**
     * 返回说明
     */
    protected String msg;
    /**
     * 提示消息
     */
    protected String tips;

    ResponseCode(int retCode, String retMsg, String tips) {
        this.status = retCode;
        this.msg = retMsg;
        this.tips = tips;
    }

}
